package com.spring.component.auth.model;

import java.io.Serializable;
import java.util.List;

/**
 * @author liushihua
 * @since 2018年03月23日
 */
public class User implements Serializable {
  private static final long serialVersionUID = 3101170255717245363L;
  private String uuid;
  private String userId;
  private String userName;
  private String department;
  private String phone;
  private String courtUuid;
  private List<Role> roles;
  private List<String> serviceIds;
  private List<UIResource> uiResources;

  public String getUuid() {
    return uuid;
  }

  public void setUuid(String uuid) {
    this.uuid = uuid;
  }

  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  public String getUserName() {
    return userName;
  }

  public void setUserName(String userName) {
    this.userName = userName;
  }

  public String getDepartment() {
    return department;
  }

  public void setDepartment(String department) {
    this.department = department;
  }

  public String getPhone() {
    return phone;
  }

  public void setPhone(String phone) {
    this.phone = phone;
  }

  public String getCourtUuid() {
    return courtUuid;
  }

  public void setCourtUuid(String courtUuid) {
    this.courtUuid = courtUuid;
  }

  public List<Role> getRoles() {
    return roles;
  }

  public void setRoles(List<Role> roles) {
    this.roles = roles;
  }

  public List<String> getServiceIds() {
    return serviceIds;
  }

  public void setServiceIds(List<String> serviceIds) {
    this.serviceIds = serviceIds;
  }

  public List<UIResource> getUiResources() {
    return uiResources;
  }

  public void setUiResources(List<UIResource> uiResources) {
    this.uiResources = uiResources;
  }

  @Override
  public String toString() {
    return "User{" + "uuid='" + uuid + '\'' + ", userId='" + userId + '\'' + ", userName='"
        + userName + '\'' + ", department='" + department + '\'' + ", phone='" + phone + '\''
        + ", courtUuid='" + courtUuid + '\'' + ", roles=" + roles + ", serviceIds=" + serviceIds
        + ", uiResources=" + uiResources + '}';
  }

  @Override
  public boolean equals(Object object) {
    if (this == object)
      return true;
    if (object == null || getClass() != object.getClass())
      return false;

    User user = (User) object;

    return userId.equals(user.userId);
  }

  @Override
  public int hashCode() {
    return userId.hashCode();
  }
}
